Functions

Thread Manager provides these functions:

Creating and Disposing of Threads

DisposeThread Deletes a thread when it finishes executing.
NewThread Creates a new thread or allocates one from the existing pool of threads.

Creating and Getting Information About Thread Pools

CreateThreadPool Creates a pool of threads for your application.
GetDefaultThreadStackSize Determines the default stack size required by a thread.
GetFreeThreadCount Determines how many threads are available to be allocated in a thread pool.
GetSpecificFreeThreadCount Determines how many threads with a stack size equal to or greater than the specified size are available to be allocated in a thread pool.

Getting Information About Specific Threads

GetCurrentThread Obtains the thread ID of the currently executing thread.
GetThreadState Obtains the state of a thread.
ThreadCurrentStackSpace Determines the amount of stack space that is available for any thread in your application.

Getting Information and Scheduling Threads During Interrupts

GetThreadCurrentTaskRef Obtains a thread task reference.
GetThreadStateGivenTaskRef Obtains the state of a thread when your application is not necessarily the current processófor example, during execution of an interrupt function.
SetThreadReadyGivenTaskRef Changes the state of a thread from stopped to ready when your application is not the current process.

Installing Custom Scheduling, Switching, Terminating, and Debugging Functions

SetDebuggerNotificationProcs Installs functions that notify the debugger when a thread is created, disposed of, or scheduled.
SetThreadScheduler Installs a custom scheduling function (custom scheduler).
SetThreadSwitcher Installs a custom context-switching function for any thread.
SetThreadTerminator Installs a custom thread-termination function for a thread.

Preventing Scheduling

SetThreadStateEndCritical Changes the state of the current thread and exits that threadís critical section at the same time.
ThreadBeginCritical Indicates that the thread is entering a critical code section.
ThreadEndCritical Indicates that the thread is leaving a critical code section.

Scheduling Threads

SetThreadState Changes the state of any thread.
YieldToAnyThread Relinquishes the current threadís control.
YieldToThread Relinquishes the current threadís control to a particular thread.

Miscellaneous

CallDebuggerDisposeThreadProc
CallDebuggerNewThreadProc
CallDebuggerThreadSchedulerProc
CallThreadEntryProc
CallThreadSchedulerProc
CallThreadSwitchProc
CallThreadTerminationProc
DisposeDebuggerDisposeThreadUPP
DisposeDebuggerNewThreadUPP
DisposeDebuggerThreadSchedulerUPP
DisposeThreadEntryUPP
DisposeThreadSchedulerUPP
DisposeThreadSwitchUPP
DisposeThreadTerminationUPP
InvokeDebuggerDisposeThreadUPP
InvokeDebuggerNewThreadUPP
InvokeDebuggerThreadSchedulerUPP
InvokeThreadEntryUPP
InvokeThreadSchedulerUPP
InvokeThreadSwitchUPP
InvokeThreadTerminationUPP
NewDebuggerDisposeThreadProc
NewDebuggerDisposeThreadUPP
NewDebuggerNewThreadProc
NewDebuggerNewThreadUPP
NewDebuggerThreadSchedulerProc
NewDebuggerThreadSchedulerUPP
NewThreadEntryProc
NewThreadEntryUPP
NewThreadSchedulerProc
NewThreadSchedulerUPP
NewThreadSwitchProc
NewThreadSwitchUPP
NewThreadTerminationProc
NewThreadTerminationUPP

© 2000 Apple Computer, Inc. — (Last Updated 3/8/2000)